-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Add save_on_exception option to ModelCheckpoint #20916
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…ining part of callbacks in individal test for better overview
…lidation callback
for more information, see https://pre-commit.ci
…sly defined epoch lenght
6249794
to
f0502ec
Compare
…ntefere with current checkpoint behavoir
def on_fit_end(self): | ||
raise RuntimeError("Trouble!") | ||
|
||
models = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets have this as test parametrisation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I move the models and callback for testing in a separate file? Because in my opinion they clutter the test file a bit too much
…onvention Co-authored-by: Jirka Borovec <[email protected]>
…eights_only to False when loading checkpoint to because default will change in future
…according to documentation
…in ModelCheckpoint
What does this PR do?
This PR adds a
save_on_exception
option to the ModelCheckpoint callback. This some of this functionality is already implemented in theOnExceptionCheckpoint
checkpoint, but I believe that bundling all checkpoint options in the ModelCheckpoint is more intuitive. Additionally, this leads to the same naming conventions and directory paths used for the exception checkpoint as for all the others.When enabled, this option serves as a contingency in case of any disruption during training, allowing one to continue from the last step before the exception occurs without losing too much progress. By printing the exception type and message, this also alleviates issue #20187.
Fixes #19686
Before submitting
PR review
Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:
Reviewer checklist
📚 Documentation preview 📚: https://pytorch-lightning--20916.org.readthedocs.build/en/20916/